/**
 * 开始启动时候调用的js，用户配置需要引入的js类库
 */
var fileNameSuffix = window.app.mode == "production" ? ".min.js?version=" + window.app.version : ".min.js?version=" + window.app.version;
//引入模块化编程内容
seajs.config({
	base: "./js/",
	alias: {
		"wechat": "lib/wechat" + fileNameSuffix,
		"template": "lib/template-native.min.js",
		"iscroll": "lib/iscroll-probe.min.js"
	}
});

//下面看看本地是否为初次登录
var isFirstLoginSys = window.localStorage.isFirstLoginSys;
if(window.app.isShowFirstLoginPages && isFirstLoginSys != "true") {
	window.localStorage.isFirstLoginSys = "true";
	window.location.href = "html/firstPage/index.html";
}

//先清除所有storage
window.sessionStorage.clear();

//加载主页面代码
seajs.use("lib/wechat.min.js?version=" + window.app.version, function() {
	if(window.app.model.toLowerCase() == "debug") {
		$script("js/data.json?version=" + window.app.version, function() {
			//调用初始化函数
			common.hideLoading();
			common.loadPage({ pageUrl: "html/login.html" });
		});
	} else {
		common.hideLoading();
		common.loadPage({ pageUrl: "html/login.html" });

	}
});

//var amapKey = window.app.amapKey;
////地图需要的js
//$script(["http://cache.amap.com/lbs/static/es5.min.js",
//	"http://webapi.amap.com/maps?v=1.3&key=" + amapKey,
//	"http://cache.amap.com/lbs/static/addToolbar.js"
//], 'mapJs');